import Vue from 'vue'
import VueRouter from 'vue-router'
import AdminView from "@/views/AdminView.vue";
// 首页
import adminHome from "@/views/admin/home.vue"
// 学生
import student from "@/views/admin/student.vue";
import classinfo from "@/views/admin/classinfo.vue";

Vue.use(VueRouter)

const routes = [
    {
        path: '/admin',
        name: 'AdminView',
        component: AdminView,
        children: [
            {
                path: '',  // 默认子路由
                name: 'Home',
                component: adminHome
            },
            // 学生
            {
                path: 'student',
                name: 'student',
                component: student
            },
            // 班级
            {
                path: 'classinfo',
                name: 'classinfo',
                component: classinfo
            }
        ]
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
